package com.rabbit.work.contoller;

import com.rabbit.work.po.Product;
import com.rabbit.work.service.IProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class ProductController {

    @Autowired
    private IProductService productService;

    @RequestMapping("/product/list")
    public String listCourses(Model model) {
        final List<Product> productList = productService.prodList();
        model.addAttribute("prodList", productList);
        return "list";
    }

}
